package learn.Reflection;

import java.lang.reflect.Field;

public class getPrivate {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchFieldException {
        Class<?> aClass = Class.forName("learn.Reflection.Student");//获取类对象
        Object stuO = aClass.newInstance(); //获取学生对象

        Field file = aClass.getDeclaredField("age");//获取类对象中的私有字段
        file.setAccessible(true);//设置取消java访问检查
        System.out.println(file);






    }
}
